﻿@{
    Layout = "~/Views/Shared/_LayoutMain.cshtml";
}

<div id="dg"></div>
<div id="where" style="padding: 5px 5px;">
    真实姓名：<input type="text" id="realName" style="width: 100px" />
    <a href="javascript:Query()" class="easyui-linkbutton" data-options="iconCls:'icon-search'">查询</a>
</div>
<script type="text/javascript">
    $(function () {
        $('#dg').datagrid({
            url: '/User/GetUserList',
            title: '用户列表',
            idField: 'id',
            border: false,
            fit: true,
            method: 'post',
            toolbar: "#where",
            pagination: true,
            pageSize: 50,
            pageNumber: 1,
            pageList: [50, 30, 20],
            columns: [[
                { field: 'id', title: '主键', checkbox: true },
                { field: 'u_UserName', title: '用户名' },
                { field: 'u_RealName', title: '真实姓名' },
                { field: 'u_MobliePhone', title: '手机号码' },
                { field: 'u_Gender', title: '性别' },
                { field: 'u_Email', title: '邮箱' },
                { field: 'u_Remark', title: '备注' },
                {
                    field: 'u_RegisterTime', title: '注册时间', formatter: function (value, row, index) {
                        if (value != "" && value != undefined && value != null) {
                            return value.toString().replace("T", " ");
                        } else {
                            return "";
                        }
                    }
                },
                {
                    field: 'u_LastLoginTime', title: '最后一次登录时间', formatter: function (value, row, index) {
                        if (value != "" && value != undefined && value != null) {
                            return value.toString().replace("T", " ");
                        } else {
                            return "";
                        }
                    }
                }
            ]]
        });
    })
    function Query() {
        $('#dg').datagrid('reload', {
            realName: $("#realName").val()
        });
    }
</script>
